<?php $view->extend('admin/realm', 'content', 
array(
	'title' => 'Realm command', 
	'tips' => 'You can run commands here. There are many commands to run!')
); ?>



<?php if ($soapEnabled):?>

<h2>Announce</h2>
<?php echo $f->id('announce')?>
<div class="response"></div>
<?php echo $f->input('hidden', 'id', $realm->id)?>
<?php echo $f->input('hidden', 'c', 'announce')?>
<p>
	<label>Text</label>
	<?php echo $f->input('text', 'args[0]')?>
</p>
<p><?php echo $f->input('submit','submit', 'Announce')?></p>
<?php echo $f->close()?>

<h2>GM Announce</h2>
<?php echo $f->id('gmAnnounce')?>
<div class="response"></div>
<?php echo $f->input('hidden', 'id', $realm->id)?>
<?php echo $f->input('hidden', 'c', 'gmAnnounce')?>
<p>
	<label>Text</label>
	<?php echo $f->input('text', 'args[0]')?>
</p>
<p><?php echo $f->input('submit','submit', 'GM Announce')?></p>
<?php echo $f->close()?>


<h2>Notify</h2>
<?php echo $f->id('notify')?>
<div class="response"></div>
<?php echo $f->input('hidden', 'id', $realm->id)?>
<?php echo $f->input('hidden', 'c', 'notify')?>
<p>
	<label>Text</label>
	<?php echo $f->input('text', 'args[0]')?>
</p>
<p><?php echo $f->input('submit','submit', 'Notify')?></p>
<?php echo $f->close()?>





<h2>Send mail</h2>
<?php echo $f->id('sendMail')?>
<div class="response"></div>
<?php echo $f->input('hidden', 'id', $realm->id)?>
<?php echo $f->input('hidden', 'c', 'sendMail')?>

<p>
	<label>Character name</label>
	<?php echo $f->input('text', 'args[0]')?>
</p>

<p>
	<label>Subject</label>
	<?php echo $f->input('text', 'args[1]')?>
</p>
<p>
	<label>Message</label>
	<?php echo $f->textarea('args[2]', null, array('rows' => 8, 'cols' => 68))?>
</p>

<p><?php echo $f->input('submit','submit', 'Send')?></p>
<?php echo $f->close()?>




<h2>Send Money</h2>
<?php echo $f->id('sendMoney')?>
<div class="response"></div>
<?php echo $f->input('hidden', 'id', $realm->id)?>
<?php echo $f->input('hidden', 'c', 'sendMoney')?>

<p>
	<label>Character name</label>
	<?php echo $f->input('text', 'args[0]')?>
</p>

<p>
	<label>Subject</label>
	<?php echo $f->input('text', 'args[1]')?>
</p>
<p>
	<label>Message</label>
	<?php echo $f->textarea('args[2]', null, array('rows' => 8, 'cols' => 68))?>
</p>

<p>
	<label>Money</label>
	<?php echo $f->input('text', 'args[3]')?>
</p>

<p><?php echo $f->input('submit','submit', 'Send')?></p>
<?php echo $f->close()?>





<?php else: ?>

<div class="message warning">
<p>You have not enabled soap for this realm in config/worlddbs.yml, please enable this (also in Server config ) before you can run any commands.</p>
</div>


<?php endif;?>




<script type="text/javascript">
/* <![CDATA[ */
$(document).ready(function(){ 
/* attach a submit handler to the form */
$("form").submit(function(event) {
/* stop form from submitting normally */
event.preventDefault(); 

/* get some values from elements on the page: */
var form = $( this );
var url = form.attr( 'action' );

/* Send the data using post and put the results in a div */
$.post( url, form.serialize(),
	function( data ) {
		form.find('.response').html('<p>' + data +'</p>');
	}
);


});

});
/* ]]> */
</script>